import request from '@/utils/request'
// 获取组织架构数据
export function getDepartments () {
  // 返回一个promise对象
  return request({
    url: '/company/department'
  })
}
// 组织架构的删除功能，动态传参来确定参数那个部门
export function delDepartments (id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}
// 组织架构的增加部门功能
export function addDepartments (data) {
  return request({
    url: '/company/department',
    method: 'POST',
    data
  })
}
// 获取某个部门详情
export function getDepartDetail (id) {
  return request({
    url: `/company/department/${id}`
  })
}
// 编辑部门
export function updateDepartments (data) {
  return request({
    url: `/company/department/${data.id}`,
    //  get post put delete
    method: 'put',
    data
  })
}
